package com.example.arithmeticleetcode.leetcode.nov;

/**
 * @program: arithmetic-leetcode
 * @description:
 * @author: FangZhen
 * @create: 2020-11-26 09:16
 **/
public class Demo18 {

    public static void main(String[] args) {

    }

    public int orangesRotting(int[][] grid) {
        int count = 0;
        for (int i = 0, len = grid.length; i < len; i++) {

            for (int j = 0, len2 = grid[i].length; j < len2; j++) {
            }
        }
        return count;
    }

    public static int[] sumZero(int n) {
        int[] arr = new int[n];
        int start = n >> 1;
        int beginIndex = 0;
        int endIndex = n - 1;
        int count = 0;
        int startValue = -start;
        int endValue= start;
        while (count < start) {
            arr[beginIndex++] = startValue++;
            arr[endIndex--] = endValue--;
            count++;
        }
        return arr;
    }
    public static int[] sumZero2(int n) {
        int[] arr = new int[n];
        int index = 0;
        int sum = 0;
        while (index < n - 1) {
            arr[index] = index;
            sum += (index++);
        }
        arr[n - 1] = -sum;
        return arr;
    }
}
